/**
*      author: Y_Yao
*      created: 2024-11-30 19:44:50
**/

#include<bits/stdc++.h>

using namespace std;
#define int LL
using LL = long long;
const LL LLINF = 1e18;
const int INF = 0x3f3f3f3f;
const int N = 2e5 + 7;
int a[N],b[N],ret[N];
priority_queue<pair<int,int>> v;
int n,m;

void solve()
{
    cin >> n >> m;
    for(int i = 1;i <= n;i++)
    {
        cin >> a[i];
    }

    for(int i = 1;i <= m;i++)
    {
        cin >> b[i];
        v.push({b[i],i});
    }

    auto t = v.top();
    for(int i = 1;i <= n;i++)
    {
        if(t.first >= a[i])
        {
            ret[t.second] = i;
            v.pop();
            if(!v.empty()) t = v.top();
            else break;
            i--;
            continue;
        }
        else
        {
            continue;
        }
    }

    for(int i = 1;i <= m;i++)
    {
        if(ret[i] != 0) cout << ret[i] << endl;
        else cout << -1 << endl;
    }
}
//在一个数组中从左往右查找第一个比某个数大的元素的下标
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}